import { reqOrderInfo, reqPayStatus } from "@/api"

export default {
    state: {
        orderInfo:{}
    },
    mutations: {
        SET_ORDERINFO(state, data) { 
            state.orderInfo = data
        },
    },
    actions: {
        async getOrderInfo({commit},id) { 
            let res = await reqOrderInfo(id);
            if (res.code == 200) { 
                commit('SET_ORDERINFO',res.data)
            }
        },
        async getPayStatus({commit},id) { 
            let res = await reqPayStatus(id)
            if (res.code == 200) { 
                return 'ok'
            }
            return Promise.reject()
        },
    },
    getters:{}
}